package com.hainatong.shiphelper.module.warehouse.adapter;

import android.view.View;
import com.chad.library.adapter.base.entity.node.BaseNode;
import com.chad.library.adapter.base.provider.BaseNodeProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.hainatong.shiphelper.R;
import com.hainatong.shiphelper.module.warehouse.entity.WareShelfBean;
import org.jetbrains.annotations.NotNull;

public class ShelfChildProvider  extends BaseNodeProvider
{
    @Override
    public int getItemViewType()
    {
        return 2;
    }

    @Override
    public int getLayoutId()
    {
        return R.layout.item_shelf_child_view;
    }

    @Override
    public void convert(@NotNull BaseViewHolder holder, BaseNode baseNode)
    {
        WareShelfBean.ChildrenBean entity = (WareShelfBean.ChildrenBean) baseNode;
        holder.setText(R.id.tv_shelf_name, entity.getCode());
        //holder.setText(R.id.tv_count, );
        /*
        if (entity.isExpanded())
        {
            holder.setImageResource(R.id.iv, R.mipmap.ic_launcher);

        }
        else
        {
            holder.setImageResource(R.id.iv, R.mipmap.ic_launcher);
        }
        */
    }

    @Override
    public void onClick(@NotNull BaseViewHolder helper, @NotNull View view, BaseNode data, int position)
    {
        WareShelfBean.ChildrenBean entity = (WareShelfBean.ChildrenBean) data;
        /*
        if (entity.isExpanded())
        {
            getAdapter().collapse(position);
        } else {
            getAdapter().expandAndCollapseOther(position);
        }
        */
    }
}
